package router

import (
	"gin-cli/app/controllers"
	"gin-cli/router/middleware"
	"github.com/gin-gonic/gin"
)

func Api(e *gin.Engine)  {
	api := e.Group("/api")
	api.Use(middleware.CheckApiToken())
	{
		api.GET("/ping", func(c *gin.Context) {
			//log.Println(c.Request.Header)
			c.JSON(200, gin.H{
				"message": "pong-post",
				//"info": c.MustGet("tokenInfo"),
			})
		})
		api.GET("/stu", controllers.Get, middleware.CheckApiToken())
	}

}
